package com.bit.ioc.component;

import com.bit.ioc.modle.Student;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class StudentComponent {
    @Bean
    public Student s1(){
        return new Student("zhuangshan",12);
    }
    @Bean
    public Student s2(){
        return new Student("lishi",22);
    }
    public String name1(){
        return "lisi";
    }
    public String name2(){
        return "zhuangsan";
    }
   public Student s3(@Qualifier("name2") String name){
        return new Student(name,12);
   }
}
